<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script>
  function jump() {
  // window.location.href
  // location.href
  // self.location.href
  // 都是本页面跳转
  //作用一样
  window.location.href="http://www.baidu.com";

//  location.href="http://www.baidu.com";

  //location.href="http://www.baidu.com";
  //self.location.href="http://www.baidu.com"; //this.location.href="http://www.baidu.com";
  //location.href="http://www.baidu.com";
   }

   function selfJump() {
      self.location.href="http://www.baidu.com";
      console.log(self);
   }
   function  parentJump() {
      parent.location.href='http://www.baidu.com';
      console.log(parent);

   }
   function  topJump() {
      top.location.href='http://www.baidu.com';
       console.log(top);
   }

</script>
</head>
<body>

<span>这是d.html:</span><span id="span1"></span><br />
<input type='button' onclick='jump();' value='location跳转'>

<span>这是d.html:</span><span id="span1"></span><br />
<input type='button' onclick='selfJump();' value='self跳转'>

<span>这是d.html:</span><span id="span1"></span><br />
<input type='button' onclick='parentJump();' value='parent跳转'>

<span>这是d.html:</span><span id="span1"></span><br />
<input type='button' onclick='topJump();' value='top跳转'>
</body>
</html>